
<script setup>
// 
import {computed , ref } from "vue";
import { useStore } from "vuex";
const store = useStore()

let kechengList = computed(() => store.state.kecheng.list)

    //   返回
    const onClickLeft = () => history.back();
const value1 = ref(0);
const value2 = ref("a");
const value3 = ref(0);
const value4 = ref("a");
const option1 = [
  { text: "选择年级", value: 0 },
  { text: "新款商品", value: 1 },
  { text: "活动商品", value: 2 },
];
const option2 = [
  { text: "学科", value: "a" },
  { text: "好评排序", value: "b" },
  { text: "销量排序", value: "c" },
];
const option3 = [
  { text: "学期", value: 0 },
  { text: "新款商品", value: 1 },
  { text: "活动商品", value: 2 },
];
const option4 = [
  { text: "筛选", value: "a" },
  { text: "好评排序", value: "b" },
  { text: "销量排序", value: "c" },
];
</script>

<template>
  <div>
    <div class="c-toubu">
      <div>
        <van-icon @click="onClickLeft" name="arrow-left" />
        <span class="xuanke">选课中心</span>
      </div>
      <div class="c-gwc"><van-icon name="cart-o" badge="9" size="24" /></div>
    </div>
    <div class="c-sousuo">
      <van-search
        v-model="value"
        placeholder="请输入搜索关键词"
        input-align="center"
      />
    </div>

    <van-dropdown-menu active-color="#1989fa">
      <van-dropdown-item v-model="value1" :options="option1" />
      <van-dropdown-item v-model="value2" :options="option2" />
      <van-dropdown-item v-model="value3" :options="option3" />
      <van-dropdown-item v-model="value4" :options="option4" />
    </van-dropdown-menu>

    <div class="c-kuang">

      <div class="c-kecheng" v-for="(item , index) in kechengList" :key="index">
        <div class="c-top">
          <div class="c-kcmc">{{item.name}}</div>
          <div>
            <van-icon name="location-o" /><span
              >丰台角门少儿学习中心220教室</span
            >
          </div>
          <div>
            <van-icon name="notes-o" /><span>{{item.startTime + item.finishTime}}</span>
          </div>
          <div>
            <van-icon name="underway-o" /><span>{{item.startTime + item.finishTime}}</span>
          </div>
        </div>
        <div class="c-xia">
          <div class="c-qian">￥<span>{{item.skPrice}}</span>/ <span>12</span>{{item.hour}}</div>
          <div class="c-gougou">
            <van-icon name="cart-o" size="24" />
            <span class="c-liji">立即购买</span>
          </div>
        </div>


      </div>

    </div>
  </div>
</template>



<style  scoped>
.c-toubu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 50px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid #999999;
  position: fixed;
  top: 0;
  background-color: #fff;
  z-index: 999;
}
.c-kecheng {
  height: 150px;
  margin-bottom: 15px;
}

.c-xuanke {
  margin-left: 10px;
}

.c-gwc {
  margin-right: 20px;
}

.c-sousuo {
  margin-top: 50px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 1px solid #999999;
  border-bottom: 1px solid #999999;
  background-color: #dddddd;
}

.c-top {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 100px;
  border-top: 1px solid #999999;
  border-bottom: 1px solid #999999;
}

.c-top div {
  margin-left: 10px;
}

.c-top div span {
  font-size: 12px;
  color: #999999;
}
.c-kcmc {
  font-size: 14px;
}

.c-xia {
  height: 50px;
  border-bottom: 1px solid #999999;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.c-liji {
  display: inline-block;
  width: 70px;
  height: 30px;
  background-color: #108ee9;
  text-align: center;
  line-height: 30px;
  color: #fff;
  margin-left: 15px;
  font-size: 14px;
}

.c-qian {
  color: red;
  margin-left: 15px;
}
.c-gougou {
  margin-right: 35px;
}

</style>